﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

using NUnitResults;

namespace NUnitResultsExplorer
{
    [ValueConversion(typeof(ITestResult), typeof(Boolean))]
    public class SuiteTypeToIsExpandedConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var s = (SuiteType)value;

            var suiteTypes = new Dictionary<SuiteType, Boolean>
            {
                { SuiteType.Assembly, true },
                { SuiteType.Namespace, true },
                { SuiteType.ParameterizedTest, false},
                { SuiteType.TestCase, false },
                { SuiteType.TestFixture, false },
                { SuiteType.TestProject, true},
                { SuiteType.Theory, false },
                { SuiteType.Unrecognised, false }
            };

            return suiteTypes[s];
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
